.TH E1432_SET_DATA_SIZE 3 E1432
.SH NAME
.nf
e1432_set_data_size \- Set size of samples to 16 or 32 bits
e1432_get_data_size \- Get current value of data size
.fi
.IX e1432_set_data_size(3) 3
.IX e1432_get_data_size(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_data_size(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 size)
SHORTSIZ16 e1432_get_data_size(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 *size)
.cE
.SH DESCRIPTION
\fIe1432_set_data_size\fR sets the sample data size, of a single
channel or group of channels \fIID\fR, to the value given in
\fIsize\fR.

The data size is mostly an internal issue.  Normally, data is read
from the E1432 module using either \fIe1432_read_float32_data\fR or
\fIe1432_read_float64_data\fR, and these functions will convert the
raw E1432 data into the requested format, regardless of the setting of
data size.

\fIe1432_get_data_size\fR returns the current value of the sample data
size, of a single channel or group of channels \fIID\fR, into a memory
location pointed to by \fIsize\fR.

This parameter is a "global" parameter.  It applies to an entire E1432
module rather than to one of its channels.  The \fIID\fR parameter is
used only to identify which module the function applies to, and all
channels in that module will report the same value for this parameter.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single channel.

\fIsize\fR selects the number of bits per sample.  The output is fixed
point, two's complement data.  The legal values for this parameter are
\fBE1432_DATA_SIZE_16\fR, \fBE1432_DATA_SIZE_32\fR,
\fBE1432_DATA_SIZE_32_SERV\fR, and \fBE1432_DATA_SIZE_FLOAT32\fR.
This parameter may also be set with \fIe1432_set_data_format\fR.

All formats are integer formats except \fBE1432_DATA_SIZE_FLOAT32\fR.
Choosing 16-bit precision allows for more data throughput on the bus.
Choosing 32 bits allows more dynamic range.  Choosing 32 bits with
\fIservice\fR (\fBE1432_DATA_SIZE_32_SERV\fR) provides additional
information in the lower eight bits of each sample.
\fBE1432_DATA_SIZE_FLOAT32\fR means that data from the channels will
be already-scaled-to-volts 32-bit IEEE floating point numbers.

\fBNote:\fR When the module is doing order tracking, then only the
32-bit integer modes are valid.

All time data read from the E1432 module will be in the format
specified.  Trailer data at the end of a block, if present, is in a
fixed format that is not affected by this data size function.  (This
trailer data is only present if it is explicitly turned on with
\fIe1432_set_append_status\fR.)  Also, frequency data, resampled time
data, and order data are not affected by the data size parameter, and
are always sent as 32-bit floating-point values.

The \fBE1432_DATA_SIZE_32_SERV\fR mode provides information about each
sample in the block, by embedding the information in the lower eight
bits of each sample.  The bottom four bits (bit number 0 through 3)
contain the digital filter pass count.  Bit 4 is set if this sample
had an overload, bit 5 is set if this sample corresponds to a trigger,
bit 6 is set if this sample caused the input channel to assert
trigger, and bit 7 is set if the input signal is above approximately
half-scale.  Bit 7 is only implemented on the E1432 inputs, not on the
E1433 inputs.

An alternative (and typically much more convenient) way to get
information about the data is to enable trailer data at the end of the
block, using \fIe1432_set_append_status\fR.

For the E1433 196 kHz input SCA, using \fBE1432_DATA_SIZE_32\fR or
\fBE1432_DATA_SIZE_FLOAT32\fR will not work when the sample clock
frequency (as set by \fIe1432_set_clock_freq\fR) is greater than 165
kHz, when using all eight channels.  Use either
\fBE1432_DATA_SIZE_16\fR or \fBE1432_DATA_SIZE_32_SERV\fR, or use
fewer than eight channels, to work around this.

.SH "RESET VALUE"
After a reset, \fIsize\fR is set to \fBE1432_DATA_SIZE_16\fR.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_set_append_status, e1432_set_data_format
.ad
